As one of countermeasures for EMI (Electro Magnetic Interference), there has conventionally been known an image forming apparatus in which an exposure period of its exposure unit is set based on the clock count of a spread spectrum clock with varying frequency. In such an image forming apparatus, however, the length of the exposure period may vary due to variations in the frequency of the spread spectrum clock. Accordingly, there has been known a technique that an integral value of a periodic function showing frequency variations of the spread spectrum clock is calculated by an integration processing unit and then the exposure period set based on the clock count of the spread spectrum clock is corrected by using the calculated integral value.